--[[/**
-- * 
 * 改变能量，溢出则增加buff
 *
 * @author heyang
-- *
-- */]]

---@class BuffEffect93101 : BaseBuffEffect
BuffEffect93101 = ClientFight.CreateClass("BuffEffect93101", ClientFight.BaseBuffEffect)
local t = BuffEffect93101

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local fighter = buff.target;
    local skill = buff.addParameters[2];

    local addEnergy = FighterManager.addEnergy(fight, fighter, skill.skill.skillId, skill.frame,
            buff.buffBean.f_BuffEffectValue[1], EnergyChangeReasonEnum.BUFF);

    if (addEnergy > 0) then
        BuffManager.addBuff(fight, buff.skill, buff.source, fighter, false, buff.buffBean.f_BuffEffectValue[2], buff.buffBean.f_BuffEffectValue[3], buff.addParameters);
        SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff"
                        .. buff.modelId .. "增加能量(" .. buff.buffBean.f_BuffEffectValue[1] .. ")溢出而增加BUFF："
                        .. buff.buffBean.f_BuffEffectValue[2]);
    else
        SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff"
                .. buff.modelId .. "增加能量(" .. buff.buffBean.f_BuffEffectValue[1] .. ")");
    end
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()